package com.ruoyi.binance.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.binance.mapper.BinanceMinAverageMapper;
import com.ruoyi.binance.domain.BinanceMinAverage;
import com.ruoyi.binance.service.IBinanceMinAverageService;

/**
 * 分钟实时日均价数据Service业务层处理
 * 
 * @author zq
 * @date 2025-08-05
 */
@Service
public class BinanceMinAverageServiceImpl implements IBinanceMinAverageService 
{
    @Autowired
    private BinanceMinAverageMapper binanceMinAverageMapper;

    /**
     * 查询分钟实时日均价数据
     * 
     * @param code 分钟实时日均价数据主键
     * @return 分钟实时日均价数据
     */
    @Override
    public BinanceMinAverage selectBinanceMinAverageByCode(String code)
    {
        return binanceMinAverageMapper.selectBinanceMinAverageByCode(code);
    }

    /**
     * 查询分钟实时日均价数据列表
     * 
     * @param binanceMinAverage 分钟实时日均价数据
     * @return 分钟实时日均价数据
     */
    @Override
    public List<BinanceMinAverage> selectBinanceMinAverageList(BinanceMinAverage binanceMinAverage)
    {
        return binanceMinAverageMapper.selectBinanceMinAverageList(binanceMinAverage);
    }

    /**
     * 新增分钟实时日均价数据
     * 
     * @param binanceMinAverage 分钟实时日均价数据
     * @return 结果
     */
    @Override
    public int insertBinanceMinAverage(BinanceMinAverage binanceMinAverage)
    {
        binanceMinAverage.setCreateTime(DateUtils.getNowDate());
        return binanceMinAverageMapper.insertBinanceMinAverage(binanceMinAverage);
    }

    /**
     * 修改分钟实时日均价数据
     * 
     * @param binanceMinAverage 分钟实时日均价数据
     * @return 结果
     */
    @Override
    public int updateBinanceMinAverage(BinanceMinAverage binanceMinAverage)
    {
        binanceMinAverage.setUpdateTime(DateUtils.getNowDate());
        return binanceMinAverageMapper.updateBinanceMinAverage(binanceMinAverage);
    }

    /**
     * 批量删除分钟实时日均价数据
     * 
     * @param codes 需要删除的分钟实时日均价数据主键
     * @return 结果
     */
    @Override
    public int deleteBinanceMinAverageByCodes(String[] codes)
    {
        return binanceMinAverageMapper.deleteBinanceMinAverageByCodes(codes);
    }

    /**
     * 删除分钟实时日均价数据信息
     * 
     * @param code 分钟实时日均价数据主键
     * @return 结果
     */
    @Override
    public int deleteBinanceMinAverageByCode(String code)
    {
        return binanceMinAverageMapper.deleteBinanceMinAverageByCode(code);
    }
}
